<template>
  <div class="banner">
    <el-carousel
      height="53.75rem"
      trigger="click"
      :interval="5000"
    >
      <el-carousel-item
        v-for="(item,index) in banner"
        :key="index"
      >
        <el-image
          :src="item"
          alt=""
          class="image"
          fit="fill"
        />
      </el-carousel-item>
    </el-carousel>
    <!-- <el-carousel
      height="700px"
      :indicator-position="'none'"
    >
      <el-carousel-item
        v-for="item in banner"
        :key="item.id"
      >
        <img
          :src="item.image"
          alt=""
          class="banner-img"
          @click="getItem(item)"
        >
      </el-carousel-item>
    </el-carousel> -->
  </div>
</template>

<script>
export default {
  name: "Banner",
  props: {},
  data() {
    return {
      banner: [],
    };
  },
  mounted() {
    this.getData();
  },
  methods: {
    getData() {
      let params = {
        shop_id:this.$route.query.id,
      }
      this.$api.commit.ShopsShow(params).then((res) => {
        if (res.code == 1) {
          console.log('获取banner', res.data.pc_head_image_arr)
          this.banner= res.data.pc_head_image_arr
        }
      });
    },
  },
};
</script>

<style scoped lang="scss">
.banner {
  height: 53.75rem;
  overflow: hidden;
  position: relative;
  margin-top: 3.5rem;
  .image {
    width: 100%;
    height: 100%;
  }
}
</style>
<style>
.el-carousel__button{
  width: 30px;
  height: 4px;
  border-radius: 20px;
  /* background-color: #f3406f */
}

</style>